<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>RF24 Library for 16 bit PIC MCUs: rf24.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">RF24 Library for 16 bit PIC MCUs
   </div>
   <div id="projectbrief">This library aims to provide PIC24 and dsPIC users an easy way to interface with the popular RF24 series chips from Nordic Semiconductor. It was developed originally as a direct port of maniacbug&#39;s Arduino RF24 library, but I went beyond that in order to increase speed for my application. The end result is a fast and easy to use library that leverages the improved speed and peripheral features present in 16 bit PIC MCUs.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">rf24.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The main header for the RF24 library.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;xc.h&gt;</code><br />
<code>#include &lt;stdint.h&gt;</code><br />
<code>#include &lt;stdbool.h&gt;</code><br />
<code>#include &quot;<a class="el" href="rf__spi_8h_source.html">rf_spi.h</a>&quot;</code><br />
</div>
<p><a href="rf24_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdebug__registers.html">debug_registers</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">structure for storing the values of all rf24 module registers (for debugging)  <a href="structdebug__registers.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:afb0b251378d3b14c508e51fd2c3157d6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afb0b251378d3b14c508e51fd2c3157d6"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>R_REGISTER</b>&#160;&#160;&#160;0x00</td></tr>
<tr class="separator:afb0b251378d3b14c508e51fd2c3157d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b68b214d5753039d2c156ad57cd7153"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3b68b214d5753039d2c156ad57cd7153"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>W_REGISTER</b>&#160;&#160;&#160;0x20</td></tr>
<tr class="separator:a3b68b214d5753039d2c156ad57cd7153"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a462d8c2314b823b724574c1ca73225a6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a462d8c2314b823b724574c1ca73225a6"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>R_RX_PAYLOAD</b>&#160;&#160;&#160;0x61</td></tr>
<tr class="separator:a462d8c2314b823b724574c1ca73225a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd12673bc8ca8559b0eee395e8845982"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd12673bc8ca8559b0eee395e8845982"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>W_TX_PAYLOAD</b>&#160;&#160;&#160;0xA0</td></tr>
<tr class="separator:afd12673bc8ca8559b0eee395e8845982"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abce47e8066832b6ac4e18162a79859b4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abce47e8066832b6ac4e18162a79859b4"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>FLUSH_TX</b>&#160;&#160;&#160;0xE1</td></tr>
<tr class="separator:abce47e8066832b6ac4e18162a79859b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2418a6171d7f1eefd458927fdfe7057"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2418a6171d7f1eefd458927fdfe7057"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>FLUSH_RX</b>&#160;&#160;&#160;0xE2</td></tr>
<tr class="separator:ab2418a6171d7f1eefd458927fdfe7057"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f1d9bb858232e8b1494b60aa9a7d25a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2f1d9bb858232e8b1494b60aa9a7d25a"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>REUSE_TX_PL</b>&#160;&#160;&#160;0xE3</td></tr>
<tr class="separator:a2f1d9bb858232e8b1494b60aa9a7d25a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14ea186f093047db160cee642e5bd901"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14ea186f093047db160cee642e5bd901"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>R_RX_PL_WID</b>&#160;&#160;&#160;0x60</td></tr>
<tr class="separator:a14ea186f093047db160cee642e5bd901"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83176d6f9c44eb5e6738176b667f6430"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83176d6f9c44eb5e6738176b667f6430"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>W_ACK_PAYLOAD</b>&#160;&#160;&#160;0xA8</td></tr>
<tr class="separator:a83176d6f9c44eb5e6738176b667f6430"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a974e6df1de481bc7796a2c1c96b6c9ff"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a974e6df1de481bc7796a2c1c96b6c9ff"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>W_TX_PAYLOAD_NOACK</b>&#160;&#160;&#160;0xB0</td></tr>
<tr class="separator:a974e6df1de481bc7796a2c1c96b6c9ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a700f88377bf36711b711f69b06c52f5d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a700f88377bf36711b711f69b06c52f5d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>NOP</b>&#160;&#160;&#160;0xFF</td></tr>
<tr class="separator:a700f88377bf36711b711f69b06c52f5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76ea3cf49247a07c54b3db005a3c7f57"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a76ea3cf49247a07c54b3db005a3c7f57"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CONFIG</b>&#160;&#160;&#160;0x00</td></tr>
<tr class="separator:a76ea3cf49247a07c54b3db005a3c7f57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa84a282351a2c9b83dd653df6ac59216"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa84a282351a2c9b83dd653df6ac59216"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>EN_AA</b>&#160;&#160;&#160;0x01</td></tr>
<tr class="separator:aa84a282351a2c9b83dd653df6ac59216"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6b2378ce9cab6ccafb6d30c774c5307"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab6b2378ce9cab6ccafb6d30c774c5307"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>EN_RXADDR</b>&#160;&#160;&#160;0x02</td></tr>
<tr class="separator:ab6b2378ce9cab6ccafb6d30c774c5307"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5ef355ba3eca336db1285cab353ddc2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af5ef355ba3eca336db1285cab353ddc2"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SETUP_AW</b>&#160;&#160;&#160;0x03</td></tr>
<tr class="separator:af5ef355ba3eca336db1285cab353ddc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2188309b3eceeae158dd64109cd919aa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2188309b3eceeae158dd64109cd919aa"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SETUP_RETR</b>&#160;&#160;&#160;0x04</td></tr>
<tr class="separator:a2188309b3eceeae158dd64109cd919aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c4da84e4a01531aa9f5c3e617848d66"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5c4da84e4a01531aa9f5c3e617848d66"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RF_CH</b>&#160;&#160;&#160;0x05</td></tr>
<tr class="separator:a5c4da84e4a01531aa9f5c3e617848d66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad95edb7665f39454d7d7fd436301712b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad95edb7665f39454d7d7fd436301712b"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RF_SETUP</b>&#160;&#160;&#160;0x06</td></tr>
<tr class="separator:ad95edb7665f39454d7d7fd436301712b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59279bee44f34d08b3cbf3a89fb0d8d9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a59279bee44f34d08b3cbf3a89fb0d8d9"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>STATUS</b>&#160;&#160;&#160;0x07</td></tr>
<tr class="separator:a59279bee44f34d08b3cbf3a89fb0d8d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a491468eaa7f2db84c152709b0b5fb1aa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a491468eaa7f2db84c152709b0b5fb1aa"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>OBSERVE_TX</b>&#160;&#160;&#160;0x08</td></tr>
<tr class="separator:a491468eaa7f2db84c152709b0b5fb1aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9743a9a0928c8f19ad9687ae6c67150"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab9743a9a0928c8f19ad9687ae6c67150"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RPD</b>&#160;&#160;&#160;0x09</td></tr>
<tr class="separator:ab9743a9a0928c8f19ad9687ae6c67150"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc82a1b0dee303d8b783b9b9a89ae5aa"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc82a1b0dee303d8b783b9b9a89ae5aa"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_ADDR_P0</b>&#160;&#160;&#160;0x0A</td></tr>
<tr class="separator:adc82a1b0dee303d8b783b9b9a89ae5aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4b44f18e4b27b07af84783d8f11726d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad4b44f18e4b27b07af84783d8f11726d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_ADDR_P1</b>&#160;&#160;&#160;0x0B</td></tr>
<tr class="separator:ad4b44f18e4b27b07af84783d8f11726d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac10ad4b1d3ace06cc269098d1863f411"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac10ad4b1d3ace06cc269098d1863f411"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_ADDR_P2</b>&#160;&#160;&#160;0x0C</td></tr>
<tr class="separator:ac10ad4b1d3ace06cc269098d1863f411"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01228e7b997954bc9d715c8289731181"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01228e7b997954bc9d715c8289731181"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_ADDR_P3</b>&#160;&#160;&#160;0x0D</td></tr>
<tr class="separator:a01228e7b997954bc9d715c8289731181"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc579afe21136cd3f72b3ac805086726"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afc579afe21136cd3f72b3ac805086726"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_ADDR_P4</b>&#160;&#160;&#160;0x0E</td></tr>
<tr class="separator:afc579afe21136cd3f72b3ac805086726"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49dfc07335896551e8c7797594658b07"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a49dfc07335896551e8c7797594658b07"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_ADDR_P5</b>&#160;&#160;&#160;0x0F</td></tr>
<tr class="separator:a49dfc07335896551e8c7797594658b07"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa734c6e08b9f794436eacbabe466a6c4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa734c6e08b9f794436eacbabe466a6c4"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>TX_ADDR</b>&#160;&#160;&#160;0x10</td></tr>
<tr class="separator:aa734c6e08b9f794436eacbabe466a6c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a060e61d8f6e7ad28984540faa85cdecf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a060e61d8f6e7ad28984540faa85cdecf"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_PW_P0</b>&#160;&#160;&#160;0x11</td></tr>
<tr class="separator:a060e61d8f6e7ad28984540faa85cdecf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa260ec97512905cec17f8ade82bc550d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa260ec97512905cec17f8ade82bc550d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_PW_P1</b>&#160;&#160;&#160;0x12</td></tr>
<tr class="separator:aa260ec97512905cec17f8ade82bc550d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38a4904a52517c8d339c689230a6567d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a38a4904a52517c8d339c689230a6567d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_PW_P2</b>&#160;&#160;&#160;0x13</td></tr>
<tr class="separator:a38a4904a52517c8d339c689230a6567d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44bdf6946c1ae047ea2a2c981244d4d8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a44bdf6946c1ae047ea2a2c981244d4d8"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_PW_P3</b>&#160;&#160;&#160;0x14</td></tr>
<tr class="separator:a44bdf6946c1ae047ea2a2c981244d4d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cdda00ab52df1537b6b5d61ef88ba8f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5cdda00ab52df1537b6b5d61ef88ba8f"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_PW_P4</b>&#160;&#160;&#160;0x15</td></tr>
<tr class="separator:a5cdda00ab52df1537b6b5d61ef88ba8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9ce52902779e18d4fed3685b0f8be582"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9ce52902779e18d4fed3685b0f8be582"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>RX_PW_P5</b>&#160;&#160;&#160;0x16</td></tr>
<tr class="separator:a9ce52902779e18d4fed3685b0f8be582"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e5c9878194f462bf7a46ca8a7b8f9d2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9e5c9878194f462bf7a46ca8a7b8f9d2"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>FIFO_STATUS</b>&#160;&#160;&#160;0x17</td></tr>
<tr class="separator:a9e5c9878194f462bf7a46ca8a7b8f9d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae79cde384e0b6a5549efb001589a79ec"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae79cde384e0b6a5549efb001589a79ec"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>DYNPD</b>&#160;&#160;&#160;0x1C</td></tr>
<tr class="separator:ae79cde384e0b6a5549efb001589a79ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf81f7b30b6c08465ce704956b446a2d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf81f7b30b6c08465ce704956b446a2d"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>FEATURE</b>&#160;&#160;&#160;0x1D</td></tr>
<tr class="separator:adf81f7b30b6c08465ce704956b446a2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6a4859af8e250ed21bc057b7540a461"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa6a4859af8e250ed21bc057b7540a461"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>REG_MASK</b>&#160;&#160;&#160;0x1F</td></tr>
<tr class="separator:aa6a4859af8e250ed21bc057b7540a461"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a7140a41ceceefb0a8d4326394aacb588"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7140a41ceceefb0a8d4326394aacb588"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>RF24_PWR_LVL</b> { <b>RF24_MINUS18_DBM</b> = 0, 
<b>RF24_MINUS12_DBM</b>, 
<b>RF24_MINUS6_DBM</b>, 
<b>RF24_0_DBM</b>
 }</td></tr>
<tr class="separator:a7140a41ceceefb0a8d4326394aacb588"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af62d2d8b5172d25cde519395caf22e11"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af62d2d8b5172d25cde519395caf22e11"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>RF24_SPEED</b> { <b>RF24_250KBPS</b> = 0, 
<b>RF24_1MBPS</b>, 
<b>RF24_2MBPS</b>
 }</td></tr>
<tr class="separator:af62d2d8b5172d25cde519395caf22e11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e888b76f6c3c21b13684c77833e40ca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9e888b76f6c3c21b13684c77833e40ca"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>RF24_CRC_MODE</b> { <b>RF24_CRC_ONE_BYTE</b> = 0, 
<b>RF24_CRC_TWO_BYTES</b>, 
<b>RF24_CRC_DISABLE</b>
 }</td></tr>
<tr class="separator:a9e888b76f6c3c21b13684c77833e40ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6920f1d3d65f63620db7d769c540f4c8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6920f1d3d65f63620db7d769c540f4c8"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>RF24_AW</b> { <b>RF24_AW_3BYTES</b> = 0, 
<b>RF24_AW_4BYTES</b>, 
<b>RF24_AW_5BYTES</b>
 }</td></tr>
<tr class="separator:a6920f1d3d65f63620db7d769c540f4c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ade88ae9dca4ba5773f157768b089654b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#ade88ae9dca4ba5773f157768b089654b">rf_init</a> (volatile uint16_t *m_LAT_REG_CE, uint8_t m_CE_pin, volatile uint16_t *m_PORT_REG_IRQ, uint8_t m_IRQ_pin)</td></tr>
<tr class="separator:ade88ae9dca4ba5773f157768b089654b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afdb9a9a37b15443c3926a93c2c4ac8d8"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#afdb9a9a37b15443c3926a93c2c4ac8d8">rf_flushTX</a> ()</td></tr>
<tr class="separator:afdb9a9a37b15443c3926a93c2c4ac8d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa052f0d2b496587d3565ac26e1ec564a"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#aa052f0d2b496587d3565ac26e1ec564a">rf_flushRX</a> ()</td></tr>
<tr class="separator:aa052f0d2b496587d3565ac26e1ec564a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26abf43b94e7a6dcfab0377e8d0edcf8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a26abf43b94e7a6dcfab0377e8d0edcf8">rf_openWritePipe</a> (uint64_t pipeAddr)</td></tr>
<tr class="separator:a26abf43b94e7a6dcfab0377e8d0edcf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87e27c94d415c73e4e384e1dfd7fd828"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a87e27c94d415c73e4e384e1dfd7fd828">rf_openReadPipe</a> (uint8_t num, uint64_t pipeAddr)</td></tr>
<tr class="separator:a87e27c94d415c73e4e384e1dfd7fd828"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6869e60b2cf28ea67afe9948029187c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a6869e60b2cf28ea67afe9948029187c2">rf_startListening</a> ()</td></tr>
<tr class="separator:a6869e60b2cf28ea67afe9948029187c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a76f0759f80e4a2562d1dbc7e031e0c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a3a76f0759f80e4a2562d1dbc7e031e0c">rf_stopListening</a> ()</td></tr>
<tr class="separator:a3a76f0759f80e4a2562d1dbc7e031e0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fc62bf762c65246d1f26d0938a2842e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a6fc62bf762c65246d1f26d0938a2842e">rf_available</a> (uint8_t *pipeNum)</td></tr>
<tr class="separator:a6fc62bf762c65246d1f26d0938a2842e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba6a2f4099336a083a4bef6a8a029171"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#aba6a2f4099336a083a4bef6a8a029171">rf_read</a> (uint8_t *buf, uint8_t len)</td></tr>
<tr class="separator:aba6a2f4099336a083a4bef6a8a029171"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a169251768e6323a4e58a6405ea52447e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a169251768e6323a4e58a6405ea52447e">rf_write</a> (const uint8_t *buf, uint8_t len)</td></tr>
<tr class="separator:a169251768e6323a4e58a6405ea52447e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b12fb5cf753495e1b3cf8db400f1446"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a8b12fb5cf753495e1b3cf8db400f1446">rf_reuseTXPayload</a> ()</td></tr>
<tr class="separator:a8b12fb5cf753495e1b3cf8db400f1446"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7021ef77c93a654981936e721c8d696a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a7021ef77c93a654981936e721c8d696a">rf_enableDynamicPayloads</a> (bool enable)</td></tr>
<tr class="separator:a7021ef77c93a654981936e721c8d696a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47d90c461f0f27470412d1f85851c403"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a47d90c461f0f27470412d1f85851c403">rf_enableACKPayloads</a> (bool enable)</td></tr>
<tr class="separator:a47d90c461f0f27470412d1f85851c403"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa97990f92518e4bf5775545ad5ac0a9d"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#aa97990f92518e4bf5775545ad5ac0a9d">rf_handleIRQ</a> ()</td></tr>
<tr class="separator:aa97990f92518e4bf5775545ad5ac0a9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ee45f271955e18fd709ec8b34f6d2e0"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a7ee45f271955e18fd709ec8b34f6d2e0">rf_readRXPayloadWidth</a> ()</td></tr>
<tr class="separator:a7ee45f271955e18fd709ec8b34f6d2e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2909f1eff3f9d347c8b5814403587ff1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a2909f1eff3f9d347c8b5814403587ff1">rf_setStaticPayloadWidth</a> (const uint8_t num, const uint8_t width)</td></tr>
<tr class="separator:a2909f1eff3f9d347c8b5814403587ff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad618c6c38cd35559a14e08ee8166f8a0"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#ad618c6c38cd35559a14e08ee8166f8a0">rf_writeACKPayload</a> (uint8_t pipe, uint8_t *buf, uint8_t len)</td></tr>
<tr class="separator:ad618c6c38cd35559a14e08ee8166f8a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aecbf9037916c43fa83aa84b848e9d294"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#aecbf9037916c43fa83aa84b848e9d294">rf_readStatus</a> ()</td></tr>
<tr class="separator:aecbf9037916c43fa83aa84b848e9d294"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5aeea99b669e584adfed01636bbd6e1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#ac5aeea99b669e584adfed01636bbd6e1">rf_setPALevel</a> (RF24_PWR_LVL pwr)</td></tr>
<tr class="separator:ac5aeea99b669e584adfed01636bbd6e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84528f81dc239d2180c5d5e43a9a1a8d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a84528f81dc239d2180c5d5e43a9a1a8d">rf_setDataRate</a> (RF24_SPEED speed)</td></tr>
<tr class="separator:a84528f81dc239d2180c5d5e43a9a1a8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9ea67f9115a347305f880cb3621d491"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#ad9ea67f9115a347305f880cb3621d491">rf_setChannel</a> (uint8_t channel)</td></tr>
<tr class="separator:ad9ea67f9115a347305f880cb3621d491"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d9ef6c435074c7265b55aafc1782d65"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a3d9ef6c435074c7265b55aafc1782d65">rf_setCRCMode</a> (RF24_CRC_MODE mode)</td></tr>
<tr class="separator:a3d9ef6c435074c7265b55aafc1782d65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6205fea4db38f346c1aee92146d9ca03"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a6205fea4db38f346c1aee92146d9ca03">rf_setNoACK</a> (bool noack)</td></tr>
<tr class="separator:a6205fea4db38f346c1aee92146d9ca03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9cccc85b8ac2f7cd26f1e1bea755fc1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#ad9cccc85b8ac2f7cd26f1e1bea755fc1">rf_setRetries</a> (uint8_t delay, uint8_t count)</td></tr>
<tr class="separator:ad9cccc85b8ac2f7cd26f1e1bea755fc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acbfb0f504d21f8dbb537b800442e4bb8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#acbfb0f504d21f8dbb537b800442e4bb8">rf_setAddressWidth</a> (RF24_AW width)</td></tr>
<tr class="separator:acbfb0f504d21f8dbb537b800442e4bb8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a211159ab2baabed6354fc93ee2b73d8f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a211159ab2baabed6354fc93ee2b73d8f">rf_testRPD</a> ()</td></tr>
<tr class="separator:a211159ab2baabed6354fc93ee2b73d8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3758c3d38e7b4880158a27b71ab7e013"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a3758c3d38e7b4880158a27b71ab7e013">rf_sendCarrier</a> (bool enable)</td></tr>
<tr class="separator:a3758c3d38e7b4880158a27b71ab7e013"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6174d4a38cae6ea268562138fb3a838d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="rf24_8h.html#a6174d4a38cae6ea268562138fb3a838d">rf_debug</a> (<a class="el" href="structdebug__registers.html">debug_registers</a> *reg)</td></tr>
<tr class="separator:a6174d4a38cae6ea268562138fb3a838d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The main header for the RF24 library. </p>
<dl class="section author"><dt>Author</dt><dd>Jeff Eaton </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a6fc62bf762c65246d1f26d0938a2842e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool rf_available </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>pipeNum</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Check and see if there is any data available to read.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pipeNum</td><td>Address of a variable in which to store the pipe number of available data. If data is available, the variable at this address will contain the number of the pipe containing data. If no data is available, 0x07 will be written.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if there is data to read, false otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="a6174d4a38cae6ea268562138fb3a838d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_debug </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdebug__registers.html">debug_registers</a> *&#160;</td>
          <td class="paramname"><em>reg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Read all device registers and store them in the <a class="el" href="structdebug__registers.html" title="structure for storing the values of all rf24 module registers (for debugging) ">debug_registers</a> struct <code>reg</code>. This is only used when testing and debugging, and should definitely not be used during high speed communications as it takes quite a bit of time to read every register.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">reg</td><td>pointer to struct in which to store register values </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a47d90c461f0f27470412d1f85851c403"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_enableACKPayloads </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enable the "ACK Payload" feature of the RF module. This allows a receiving module to automatically send back data attached to an ACK packet. Enabling this feature also enables dynamic payloads, which are required for ACK payloads to function.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="rf24_8h.html#a7021ef77c93a654981936e721c8d696a">rf_enableDynamicPayloads</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">enable</td><td>True to enable ACK payloads, false to disable </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a7021ef77c93a654981936e721c8d696a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_enableDynamicPayloads </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enable the "dynamic payloads" feature of the RF module. This allows packet payloads to be any size between 0 and 32 bytes, instead of forcing all packet payloads to be the same size.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">enable</td><td>True to enable dynamic payloads, false to disable </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aa052f0d2b496587d3565ac26e1ec564a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t rf_flushRX </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function to flush the contents of the RX register.</p>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="afdb9a9a37b15443c3926a93c2c4ac8d8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t rf_flushTX </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Function to flush the contents of the TX register.</p>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="aa97990f92518e4bf5775545ad5ac0a9d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t rf_handleIRQ </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>&mdash; NYI &mdash; Look at the status register and figure out what fired the interrupt. This would make it possible to do non-blocking writes and handle the ACK with an interrupt</p>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="ade88ae9dca4ba5773f157768b089654b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_init </td>
          <td>(</td>
          <td class="paramtype">volatile uint16_t *&#160;</td>
          <td class="paramname"><em>m_LAT_REG_CE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>m_CE_pin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">volatile uint16_t *&#160;</td>
          <td class="paramname"><em>m_PORT_REG_IRQ</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>m_IRQ_pin</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize the chip and get everything ready to use. Call this before calling anything else</p>
<dl class="section warning"><dt>Warning</dt><dd>This assumes that the TRIS registers for the CE and IRQ pins are properly set! Make sure you have the CE pin set as an output (0) and the IRQ pin set as an input (1). Also make sure the analog capability on both pins is disabled. (AD1PCFGL, bit set = disabled)</dd>
<dd>
This function also assumes that SPI1 has been configured and enabled already. If you don't configure and enable SPI1, this library won't work at all.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">m_LAT_REG_CE</td><td>pointer to the LAT register containing the desired CE_pin </td></tr>
    <tr><td class="paramname">m_CE_pin</td><td>which bit in m_LAT_REG_CE is the desired CE pin </td></tr>
    <tr><td class="paramname">m_PORT_REG_IRQ</td><td>pointer to the PORT register containing the desired IRQ pin </td></tr>
    <tr><td class="paramname">m_IRQ_pin</td><td>which bit in m_PORT_REG_IRQ is the desired IRQ pin </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a87e27c94d415c73e4e384e1dfd7fd828"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_openReadPipe </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>pipeAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Open a pipe for reading. <code>pipeAddr</code> should match the write pipe address of the transmitting module. Up to six pipes can be open at a time, corresponding to <code>num</code> values of 0 - 5.</p>
<dl class="section warning"><dt>Warning</dt><dd>Pipes 1-5 must have the same address EXCEPT for the LSB. The LSB on all pipes must be different.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">num</td><td>Which pipe to open. (0 through 5) </td></tr>
    <tr><td class="paramname">pipeAddr</td><td>The address of the read pipe. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a26abf43b94e7a6dcfab0377e8d0edcf8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_openWritePipe </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>pipeAddr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Open a pipe for writing. <code>pipeAddr</code> should match the read pipe address of the receiving module. The length of the address should correspond with the value stored in the SETUP_AW register. </p><dl class="section see"><dt>See also</dt><dd>setAddressWidth</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pipeAddr</td><td>The address of the pipe to open </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aba6a2f4099336a083a4bef6a8a029171"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool rf_read </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Read data from the RF module into RAM. Call this if rf_available returns true. If you have dynamic payloads enabled, <code>len</code> should be the value returned from <a class="el" href="rf24_8h.html#a7ee45f271955e18fd709ec8b34f6d2e0">rf_readRXPayloadWidth()</a>.</p>
<dl class="section warning"><dt>Warning</dt><dd>I'm not sure what would happen if you called this while nothing is available or you haven't yet called startListening().</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="rf24_8h.html#a6fc62bf762c65246d1f26d0938a2842e">rf_available</a> </dd>
<dd>
<a class="el" href="rf24_8h.html#a7ee45f271955e18fd709ec8b34f6d2e0">rf_readRXPayloadWidth</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>Pointer to RAM in which to store the received data </td></tr>
    <tr><td class="paramname">len</td><td>Number of bytes to read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if you have read all available data, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a7ee45f271955e18fd709ec8b34f6d2e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t rf_readRXPayloadWidth </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Read the width of the first payload in the RX buffer. This is used when dynamic payload width is enabled. If this value is greater than 32, the RX buffer will be flushed automatically.</p>
<dl class="section return"><dt>Returns</dt><dd>Number of bytes in the top RX payload </dd></dl>

</div>
</div>
<a class="anchor" id="aecbf9037916c43fa83aa84b848e9d294"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t rf_readStatus </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reads the status register.</p>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="a8b12fb5cf753495e1b3cf8db400f1446"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t rf_reuseTXPayload </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Reuse last transmitted payload. This will be active until either <a class="el" href="rf24_8h.html#afdb9a9a37b15443c3926a93c2c4ac8d8">rf_flushTX()</a> or rf_writePayload() is called.</p>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="a3758c3d38e7b4880158a27b71ab7e013"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_sendCarrier </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Transmit a constant carrier wave on the current channel. This function is used for testing various things including range, interference, if your stuff is wired correctly, etc.</p>
<dl class="section warning"><dt>Warning</dt><dd>Only use for testing! Don't call this during normal tx/rx operation</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">enable</td><td>True to enable carrier signal, false to disable </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="acbfb0f504d21f8dbb537b800442e4bb8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_setAddressWidth </td>
          <td>(</td>
          <td class="paramtype">RF24_AW&#160;</td>
          <td class="paramname"><em>width</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the address width to be used with read and write pipes. Valid values are found in the RF24_AW enum.</p>
<dl class="section see"><dt>See also</dt><dd>openReadPipe </dd>
<dd>
openWritePipe</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">width</td><td>Address width to be used </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad9ea67f9115a347305f880cb3621d491"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_setChannel </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>channel</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the communications channel. This ranges from 2.4GHz to ~2.525GHz. Valid input values are between 0 and 127.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">channel</td><td>Which frequency channel to operate on </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="a3d9ef6c435074c7265b55aafc1782d65"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_setCRCMode </td>
          <td>(</td>
          <td class="paramtype">RF24_CRC_MODE&#160;</td>
          <td class="paramname"><em>mode</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the CRC mode of communications. Possible options are one byte and two byte CRC.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">mode</td><td>One of the RF24_CRC_MODE values defined in the enum in <a class="el" href="rf24_8h.html" title="The main header for the RF24 library. ">rf24.h</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="a84528f81dc239d2180c5d5e43a9a1a8d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_setDataRate </td>
          <td>(</td>
          <td class="paramtype">RF24_SPEED&#160;</td>
          <td class="paramname"><em>speed</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the rate at which data is transmitted.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">speed</td><td>One of the speed values defined in the RF24_SPEED enum in <a class="el" href="rf24_8h.html" title="The main header for the RF24 library. ">rf24.h</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="a6205fea4db38f346c1aee92146d9ca03"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_setNoACK </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>noack</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the "No ACK" mode for all transmitted packets. Enabling this means that the transmitter will not wait and listen for an ACK packet after each transmission.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">noack</td><td>True to enable "No ACK" mode, false to disable (true = no acks, false = acks) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac5aeea99b669e584adfed01636bbd6e1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_setPALevel </td>
          <td>(</td>
          <td class="paramtype">RF24_PWR_LVL&#160;</td>
          <td class="paramname"><em>pwr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the power amplifier level.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pwr</td><td>one of the power levels defined in the RF24_PWR_LVL enum in <a class="el" href="rf24_8h.html" title="The main header for the RF24 library. ">rf24.h</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
<a class="anchor" id="ad9cccc85b8ac2f7cd26f1e1bea755fc1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_setRetries </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>delay</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the time between transmission retries as well as the number of retries attempted before a packet fails to send.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">delay</td><td>Time between retry attempts (0-15) </td></tr>
    <tr><td class="paramname">count</td><td>Maximum number of retries (0-15) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2909f1eff3f9d347c8b5814403587ff1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_setStaticPayloadWidth </td>
          <td>(</td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>width</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the width of expected payloads on pipe <code>num</code>. This allows the read function to return the correct amount of data when dynamic payloads is disabled.</p>
<p>Passing a <code>num</code> value greater than 5 will set the width for all RX pipes.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">num</td><td>Which read pipe the width is being set for </td></tr>
    <tr><td class="paramname">width</td><td>Number of bytes in incoming payloads </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a6869e60b2cf28ea67afe9948029187c2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_startListening </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Put the RF24 device into RX mode and wait for data to arrive. Before calling this function, open some pipes to listen on by using <a class="el" href="rf24_8h.html#a87e27c94d415c73e4e384e1dfd7fd828">rf_openReadPipe()</a>. Call <a class="el" href="rf24_8h.html#a6fc62bf762c65246d1f26d0938a2842e">rf_available()</a> to see if there's any data to read, and then read() to read it</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="rf24_8h.html#a87e27c94d415c73e4e384e1dfd7fd828">rf_openReadPipe</a></dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>Don't call write() while listening - call stopListening() first. </dd></dl>

</div>
</div>
<a class="anchor" id="a3a76f0759f80e4a2562d1dbc7e031e0c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_stopListening </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Call this when you want to drop out of listening mode. Always call this before you write() if you were previously reading. </p>

</div>
</div>
<a class="anchor" id="a211159ab2baabed6354fc93ee2b73d8f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool rf_testRPD </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Test the received power. This is a useful function to check for a carrier frequency or interference on a given channel.</p>
<dl class="section return"><dt>Returns</dt><dd>True if received power is above -64dBm, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a169251768e6323a4e58a6405ea52447e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void rf_write </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Write data from RAM into the RF module and transmit it. Make sure you have an open writing pipe before you call this.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="rf24_8h.html#a26abf43b94e7a6dcfab0377e8d0edcf8">rf_openWritePipe</a></dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>Don't call this if you are actively listening for data! Call <a class="el" href="rf24_8h.html#a3a76f0759f80e4a2562d1dbc7e031e0c">rf_stopListening()</a> first.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>Data to write </td></tr>
    <tr><td class="paramname">len</td><td>Number of bytes to write </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad618c6c38cd35559a14e08ee8166f8a0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t rf_writeACKPayload </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>pipe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Write an ACK Payload to a given RX Pipe. When a packet is received on that pipe, the ACK Payload will be attached to the ACK packet and sent back to the other module.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="rf24_8h.html#a47d90c461f0f27470412d1f85851c403">rf_enableACKPayloads</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pipe</td><td>Which RX pipe the ACK payload will be attached to (0-5) </td></tr>
    <tr><td class="paramname">buf</td><td>Data to be sent in the ACK payload </td></tr>
    <tr><td class="paramname">len</td><td>Number of bytes to send </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>STATUS register contents </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Feb 20 2015 20:21:26 for RF24 Library for 16 bit PIC MCUs by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
